package com.bbcare.department.plat.store.ibatis;

import java.util.List;
import java.util.Map;

import com.bbcare.department.plat.entity.BrowsDetail;
import com.bbcare.department.plat.entity.EducationContent;
import com.bbcare.department.plat.entity.EducationContentInfo;
import com.bbcare.department.plat.entity.EducationTemplate;

public interface IEducationDao {
	/**
	 * 通过条件分页查询宣教内容
	 * @param id
	 * @return
	 */
	List<EducationContentInfo> selectContentsByCondition(Map<String,Object> paramMap) throws Exception;
	
	//app提供宣教列表查询  无规则随机查询4条
	List<Map<String,Object>> selectContentsForApp(Map<String,Object> paramMap) throws Exception;
	
	/**
	 * 通过条件查询模板内容
	 * @param paramMap
	 * @return
	 * @throws Exception
	 */
	EducationContentInfo selectContentById(Map<String,Object> param) throws Exception;

	/**
	 * 通过id查询模板详情
	 * @param id
	 * @return
	 */
	EducationTemplate selectTemplateById(Map<String,Object> map) throws Exception;
     
     
 	 List<EducationTemplate> selectTemplatesByCondition(Map<String,Object> paramMap) throws Exception;

	/**
	 * 更新浏览次数  
	 * @param id
	 * @return
	 */
	 int updateBrowse(Map<String,Object> paramMap) throws Exception;
	 
	 //更新宣教模板引用量
	 int updateEducationTemplate(Map<String,Object> paramMap) throws Exception;
	 
	 //更新宣教模板浏览量  (？暂时统计单独模板的浏览)
	 int updateEducationTemplateBrowse(Map<String,Object> paramMap) throws Exception;
	
	/**
	 * 删除宣教
	 * @param id
	 * @return
	 */
	 int deleteyIds(List<String> ids) throws Exception;
	
	
	/**
	 * 更新宣教
	 * @param account
	 * @return
	 */
	 int update(EducationContent doctor) throws Exception;
	 
	 int stopEducation(EducationContent doctor) throws Exception;
	/**
	 * 保存宣教
	 * @param account
	 * @return
	 */
	 int save(EducationContent doctor) throws Exception;
	 
	 /**
	  * 保存浏览次数
	  */
	 int saveBrowse(BrowsDetail doctor) throws Exception;
	 
	 	/**
		 * 通过科室ID查询所有宣教
		 * @param id
		 * @return
		 */
	 int countByDepId(Map<String,Object> paramMap) throws Exception;
	 
	 int templateCount(Map<String,Object> map) throws Exception;
	 
	 /**
	  * 按天查询科室宣教浏览量 7天
	  */
	 List<Map<String,Object>> countBrowseByDay(Map<String,Object> paramMap);
	 
	 /**
	  * 按月查询科室宣教浏览量 8月
	  */
	 List<Map<String,Object>> countBrowseByMonth(Map<String,Object> paramMap);

}
